package day04;
//for结构的演示
public class ForDemo {
    public static void main(String[] args) {
        //for中的循环变量num的作用域,仅在当前for中-----特殊记忆
        for (int num =1;num<=9;num++){//乘法表 1到9
            System.out.println(num+"*9="+num*9);
        }
        //System.out.println(num);//编译错误,超出num作用域了
        for (int num = 1;num<=9;num+=2){//乘法表 1,3,5,7,9
            System.out.println(num+"*9="+num*9);
        }
        for (int num = 9;num>=1;num--){//乘法表 9到1
            System.out.println(num+"*9="+num*9);
        }
        for (int times = 0;times<5;times++){
            System.out.println("行动是成功的阶梯");
        }
        /*
          执行过程:
          times = 0   true   输出
          times = 1   true   输出
          times = 2   true   输出
          times = 3   true   输出
          times = 4   true   输出
          times = 5   false  for循环结束
         */
    }
}
